//package com.oyjd.ws.server;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import javax.annotation.Resource;
//import javax.jws.WebMethod;
//import javax.jws.WebParam;
//import javax.jws.WebService;
//import javax.jws.soap.SOAPBinding;
//import javax.jws.soap.SOAPBinding.Style;
//import javax.jws.soap.SOAPBinding.Use;
//import javax.servlet.http.HttpServletRequest;
//import javax.xml.ws.Binding;
//import javax.xml.ws.Endpoint;
//import javax.xml.ws.WebServiceContext;
//import javax.xml.ws.handler.Handler;
//import javax.xml.ws.handler.MessageContext;
//
//import com.oyjd.business.bean.vo.UserVO;
//import com.oyjd.fw.ws.ServerHandler;
//import com.sun.xml.internal.ws.api.message.Header;
//import com.sun.xml.internal.ws.api.message.HeaderList;
//import com.sun.xml.internal.ws.developer.JAXWSProperties;
//
///**
// * webservice 基本服务器
// * 
// * @author 欧建东
// * @email oyjd@163.com
// * 
// */
//@WebService()
//@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
//public class Hello {
//
//	@Resource
//	WebServiceContext context;
//	
//	public String getMessage(@WebParam(header = true) String name, int age) {
//		HttpServletRequest request = (HttpServletRequest) context.getMessageContext().get(MessageContext.SERVLET_REQUEST);
//		if (null != request) {
//			System.out.println("url--->" + request.getRequestURL());
//			System.out.println("request ip:--->" + request.getRemoteAddr());
//		}
//		
//		String s = "我叫" + name + ",今年" + age + "岁";
//		return s;
//	}
//	
//	public String getMessage2(String name, int age) {
//		HeaderList list = (HeaderList) context.getMessageContext().get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY);
//		for (Header h : list) {
//			System.out.println("head-->" + h.getStringContent());
//		}
//		
//		String s = "我叫" + name + ",今年" + age + "岁";
//		return s;
//	}
//
//	@WebMethod(exclude = true)
//	public String getIdcard() {
//		return "2341542134";
//	}
//
//	public UserVO getUserVO(UserVO vo) {
//		return new UserVO();
//	}
//
//	@SuppressWarnings("rawtypes")
//	public static void main(String[] args) {
//		Endpoint endpoint = Endpoint.create(new Hello());
//		Binding binding = endpoint.getBinding();
//		List<Handler> handlerChain = new ArrayList<Handler>();
//		handlerChain.add(new ServerHandler());
//		binding.setHandlerChain(handlerChain);
//		endpoint.publish("http://localhost:567/abc");
//
//		// -----------------下面发布方式，无法获取链路，估计是完成后handleMessage 返回false而被忽略
//		// Endpoint endpoint =Endpoint.publish("http://localhost:567/abc", new
//		// Hello());
//		// Binding binding = endpoint.getBinding();
//		// List<Handler> handlerChain = new ArrayList<Handler>();
//		// handlerChain.add(new ServerHandler());
//		// binding.setHandlerChain(handlerChain);
//		System.out.println("server ok");
//	}
//}
